﻿<%@ Page Language="C#" EnableEventValidation="false" AutoEventWireup="true" CodeFile="ServiceGuest.aspx.cs" Inherits="Services_ServiceGuest" %>
<%@ Register Src="../usercontrol/PageUrlGridView.ascx" TagName="PageUrlGridView" TagPrefix="uc1" %>
<html>
<head id="Head1" runat="server">
<title>维修处理</title>
<link href="../css/adminCss.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/changerows.js"></script>
<script type="text/javascript" src="../js/Check.js"></script>
<script type="text/javascript" src="../js/rl.js"></script>
<script type="text/javascript">
function CheckAll(form) {
    for (var i=0;i<form.elements.length;i++) {
	    var e = form.elements[i];
	    if (e.name != 'chkall' && e.type=='checkbox')
		    e.checked = form.chkall.checked;
    }
}

function PrintData(id)
{
    if(id!="")
    {
        openwin(800,550,"DrawPrint.aspx?id="+id);
    }
}
</script>
<style type="text/css">
.trBg{background:#FFCC33;}

</style>
</head>
<body>
    <form id="form1" runat="server">
        <table width="99%" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td  width="25px"><img src="../images/module.gif" width="20" height="22" alt=""/></td>
                <td><asp:Label ID="lblPath" runat="server" ></asp:Label></td>
           </tr>
        </table>
        <table width="99%" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td bgcolor="#3CB6E5" height="5px"></td>
            </tr>
        </table>
        <table width="99%" border="0" cellpadding="0" cellspacing="0">
                <tr>
                <td  align="left" style="height: 25px">
                    <img src="../images/search.gif" alt="搜索" width="16" height="16" />
                            预约时间：<asp:TextBox  ID="yjTm1" runat="server" CssClass="input1" MaxLength="10" Width="70px" onclick="SelectDate(this.name)"></asp:TextBox>至<asp:TextBox ID="yjTm2" runat="server" CssClass="input1" MaxLength="10" Width="70px" onclick="SelectDate(this.name)"></asp:TextBox>
                            客户名称：<asp:TextBox ID="Guestname" runat="server" CssClass="input1" Width="70px"></asp:TextBox>
                            联系电话：<asp:TextBox ID="Guesttel" runat="server" CssClass="input1" Width="70px"></asp:TextBox>
                            业务编号：<asp:TextBox ID="MaintCode" runat="server" CssClass="input1" Width="70px"></asp:TextBox>
                            型号：<asp:TextBox ID="comidSpe" runat="server" CssClass="input1" Width="70px"></asp:TextBox>
                            条码：<asp:TextBox ID="code" runat="server" CssClass="input1" Width="70px"></asp:TextBox>
                            地址：<asp:TextBox ID="Guestaddress" runat="server" CssClass="input1" Width="70px"></asp:TextBox>
                            维修人：<asp:DropDownList ID="maintmen" runat="server"/>
                    <asp:Button ID="btnSearch" runat="server" Text=" 搜索 " CssClass="submit" OnClick="btnSearch_Click" />
                    <asp:Button ID="btnAdd" runat="server" CssClass="submit" OnClick="btnAdd_Click" Text=" 添加 " /></td>
            </tr>
        </table>
        <table width="99%" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td bgcolor="#3CB6E5" height="5px">
                </td>
            </tr>
        </table>
        <asp:GridView ID="GvData" runat="server" Width="99%" AutoGenerateColumns="False" CssClass="gridview" OnRowDataBound="GvData_RowDataBound" EmptyDataText="没有数据" >
             <RowStyle Height="25px" HorizontalAlign="Center"  />
            <PagerSettings Visible="False" />
            <Columns>
                <asp:BoundField HeaderText="业务编号" DataField="MaintCode"/>
                 <asp:TemplateField HeaderText="客户名称"  ItemStyle-CssClass="nobr">
                    <ItemTemplate>
                            <asp:LinkButton ID="Guestname" Text='<%# Bind("Guestname") %>'  CommandArgument='<%#Eval("Maintaddid") %>' runat="server" OnClick="linkedit_Click">报修</asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField HeaderText="联系电话" DataField="Guesttel" ItemStyle-CssClass="nobr"/>
                <asp:BoundField HeaderText="客户地址" DataField="Guestaddress"/>
                <asp:BoundField HeaderText="类型" DataField="comitype"/>
                <asp:BoundField HeaderText="品牌" DataField="comidband"/>
                <asp:BoundField HeaderText="型号" DataField="comidSpe"/>
                <asp:TemplateField HeaderText="报修日期">
                    <ItemTemplate><asp:Label ID="lblMaintDate" Text='<%# Bind("MaintDate","{0:d}") %>'  runat="server"/></ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="预约时间">
                    <ItemTemplate><asp:Label ID="lblBespeakDate" Text='<%# Bind("BespeakDate","{0:d}") %>'  runat="server"/></ItemTemplate>
                </asp:TemplateField>
                 <asp:BoundField HeaderText="维修人" DataField="StaffName"/>
                <asp:BoundField HeaderText="报修故障"　DataField="MaintTrouble"/>
                <asp:TemplateField HeaderText="操作"   ItemStyle-CssClass="nobr">
                    <ItemTemplate><asp:LinkButton ID="linkbtnSales"  CommandArgument='<%#Eval("Maintaddid") %>' runat="server" OnClick="linkedit_Click" ForeColor="Red">修改</asp:LinkButton><asp:LinkButton ID="LinkButton1"  CommandArgument='<%#Eval("Maintaddid") %>' runat="server" OnClick="linkBalance_Click" ForeColor="Red">结算</asp:LinkButton></ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="打印"   ItemStyle-CssClass="nobr">
                    <ItemTemplate><a  href='javascript:PrintData(<%#Eval("Maintaddid") %>)'  class="F_Red">打印</a></ItemTemplate>
                </asp:TemplateField>
            <asp:TemplateField HeaderText="选择">
                    <ItemTemplate>
                        <asp:CheckBox ID="ckFlag" runat="server"  />
                    </ItemTemplate>
            </asp:TemplateField>
            </Columns>
            <EmptyDataRowStyle ForeColor="Red" HorizontalAlign="Center" />
        </asp:GridView>
        <table align="center" width="99%">
            <tr>
                <td><uc1:PageUrlGridView ID="PageNavigator1" runat="server" DataId="GvData" ConnectionString="connstr" ShowType="Num" PageSize="20" /></td>
                <td align="right"><input type="checkbox" name="chkall"  onclick="CheckAll(this.form)" value="on"/><font color="#FF0000">全选</font>&nbsp;<asp:Button ID="Button1" runat="server" CssClass="submit" OnClick="btnAdd_Click" Text="添加" />
                    <asp:Button ID="btnExcel" runat="server" Text="导出" CssClass="inputExcel" OnClick="btnExcel_Click"  />
                    <asp:Button ID="Button3" runat="server" Text="删除" CssClass="submit" OnClick="btnDel_Click"  /></td>
            </tr>
        </table>
        <asp:HiddenField ID="HidWareid" runat="server" />
        <asp:HiddenField ID="hfxs" runat="server" />
    </form>
</body>
</html>
    